{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts \n",
    "from pyecharts.charts import Pie"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stderr",
     "text": [
      "C:\\Python3_7_2\\lib\\site-packages\\pyecharts\\charts\\chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n  super().__init__(init_opts=init_opts)\n"
     ]
    }
   ],
   "source": [
    "c=(\n",
    "    Pie().add_dataset(\n",
    "        source=[[\"时间\",\"上月\",\"上周\",\"本周\",\"下周\",\"下月\"],\n",
    "                ['跟踪',100,20,10,15,80],\n",
    "                ['美术',200,50,40,60,180],\n",
    "                ['模型',400,50,30,40,300],\n",
    "                ['场景',300,40,50,60,250],\n",
    "                ['特效',400,100,80,90,300]\n",
    "        ]\n",
    "    ).add(\n",
    "        series_name='上月',\n",
    "        data_pair= [['A','B'],[1,2]],\n",
    "        # color=['#F4A460','#E9967A','#8B7E66','#BA55D3','#FFB5C5','#4876FF','#CAE1FF','#3CB371'],\n",
    "        color=['#8B7E66'],\n",
    "        radius=60,\n",
    "        center=['25%','30%'],\n",
    "        encode={'itemName':\"时间\",\"value\":\"上月\"},\n",
    "    ).add(\n",
    "        series_name='上周',\n",
    "        data_pair=[],\n",
    "        radius=60,\n",
    "        center=['25%','75%'],\n",
    "        encode={'itemName':\"时间\",\"value\":\"上周\"},\n",
    "    ).add(\n",
    "        series_name='本周',\n",
    "        data_pair=[],\n",
    "        radius=60,\n",
    "        center=['50%','50%'],\n",
    "        encode={'itemName':\"时间\",\"value\":\"本周\"},\n",
    "    ).add(\n",
    "        series_name='下周',\n",
    "        data_pair=[],\n",
    "        radius=60,\n",
    "        center=['75%','75%'],\n",
    "        encode={'itemName':\"时间\",\"value\":\"下周\"},\n",
    "    ).add(\n",
    "        series_name='下月',\n",
    "        data_pair=[],\n",
    "        radius=60,\n",
    "        center=['75%','30%'],\n",
    "        encode={'itemName':\"时间\",\"value\":\"下月\"},\n",
    "    ).set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"部门各时间端工时分配\"),\n",
    "        legend_opts=opts.LegendOpts(pos_left=\"30%\", pos_top=\"2%\"),\n",
    "    )\n",
    "    .render(\"department_pie.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}